package com.yiyuzi.admin.privilege;

import com.yiyuzi.admin.common.domain.ResponseDTO;
import com.yiyuzi.admin.privilege.service.PrivilegeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author yiyuzi
 * @date 2021/5/7 11:20
 */

@RestController
@RequestMapping(value = "privilege")
@Api(tags = "权限")
public class PrivilegeController {
    @Resource
    PrivilegeService privilegeService;

    @PostMapping("/query/tree")
    @ApiOperation(value = "获取权限树")
    public ResponseDTO<?> listToTree(){
        return ResponseDTO.res(privilegeService.listToTree());
    }
}
